• The proxy object for the current map style.

    MGLStyle provides a set of convenience methods for changing Mapbox default styles using -[MGLMapView styleURL]. Learn more about Mapbox default styles.

    It is also possible to directly manipulate the current map style via -[MGLMapView style] by updating the style’s data sources or layers.

    Note

    Wait until the map style has finished loading before modifying a map’s style via any of the MGLStyle instance methods below. You can use the MGLMapViewDelegate methods -mapViewDidFinishLoadingMap: or -mapView:didFinishLoadingStyle: as indicators that it’s safe to modify the map’s style.
    See more

    Declaration

    Objective-C

    @interface MGLStyle : NSObject

    Swift

    class MGLStyle : NSObject
  • An MGLStyleValue object is a generic container for a style attribute value. The layout and paint attribute properties of MGLStyleLayer can be set to MGLStyleValue objects.

    The MGLStyleValue class itself represents a class cluster. Under the hood, a particular MGLStyleValue object may be either an MGLStyleConstantValue to represent a constant value or an MGLStyleFunction to represent a value function. Do not initialize an MGLStyleValue object directly; instead, use one of the class factory methods to create an MGLStyleValue object.

    The MGLStyleValue class takes a generic parameter T that indicates the Foundation class being wrapped by this class. Common values for T include:

    • NSNumber (for Boolean values and floating-point numbers)
    • NSValue (for CGVector, NSEdgeInsets, UIEdgeInsets, and enumerations)
    • NSString
    • NSColor or UIColor
    • NSArray
    See more

    Declaration

    Objective-C

    @interface MGLStyleValue <T> : NSObject

    Swift

    class MGLStyleValue